package com.lyc.common.exception;

import java.io.Serializable;

import com.lyc.common.common.DepartCommonResult;
import com.lyc.common.constants.DepartCommonConstant;

/**
 * @Author 李大神仙
 * @Date 2024/2/28 20:40
 * @Version 1.0
 */
public class DepartException extends RuntimeException implements Serializable {
    private String errorCode;

    private String errorMessage;

    private Object data;

    public DepartException(String errorCode,String errorMessage){
        super(errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public DepartException(String errorCode,String errorMessage,Object data){
        super(errorMessage);
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
        this.data = data;
    }

    /*public DepartException(String errorCode){
        super(errorMessage);
        this.errorCode = DepartCommonConstant.NetStatus.ERROR_STRING;
        this.errorMessage = errorCode;
    }*/

    /*public DepartException(IError iError){
        super(iError.getMessage());
        this.errorCode = iError.getCode();
        this.errorMessage = iError.getMessage();
    }*/

    /*public DepartException(DepartCommonResult departCommonResult){
        super(departCommonResult.getMessage());
        this.errorCode = departCommonResult.getCode();
        this.errorMessage = departCommonResult.getMessage();
        this.data = departCommonResult.getData();
    }*/

    public DepartException(String message,Throwable cause){
        this(DepartCommonConstant.NetStatus.ERROR_STRING,message,cause);
    }

    /*public DepartException(String code,String message,Throwable cause){
        super(message,cause);
        this.errorCode = code;
        log.error(message,cause);
    }*/
}
